/* 文档管理组件样式 */

/* 主要内容区域 */
.app-main-document {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.document-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  gap: 25px;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

/* 标题区域 */
.document-header {
  text-align: center;
  margin-bottom: 10px;
}

.document-header h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  color: #1976d2;
  font-weight: 600;
}

.document-header p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

/* 上传区域 */
.upload-section {
  flex-shrink: 0;
}

.upload-container {
  background: linear-gradient(135deg, #f0f8ff 0%, #e3f2fd 100%);
  border: 2px dashed #42a5f5;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
}

.upload-container:hover {
  border-color: #1976d2;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(25, 118, 210, 0.15);
}

.upload-btn {
  background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
  margin-bottom: 10px;
}

.upload-btn:hover {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

.upload-info {
  color: #666;
  font-size: 13px;
  margin-top: 8px;
}

/* 文档列表区域 */
.documents-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.documents-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 10px;
  gap: 15px;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.documents-header h3 {
  margin: 0;
  color: #1976d2;
  font-size: 18px;
  font-weight: 600;
}

.documents-count {
  font-size: 13px;
  color: #666;
  background: rgba(25, 118, 210, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(25, 118, 210, 0.2);
}

.documents-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
  padding: 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border: 1px solid rgba(25, 118, 210, 0.1);
}

.refresh-btn {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 1px solid #42a5f5;
  color: #1976d2;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.refresh-btn:hover {
  background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.2);
}

.action-btn-secondary {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #6c757d;
  color: #495057;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn-secondary:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
}

.action-btn-primary {
  background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
  border: 1px solid #28a745;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn-primary:hover {
  background: linear-gradient(135deg, #218838 0%, #28a745 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.action-btn-primary:disabled {
  background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
  border-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.action-btn-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border: 1px solid #dc3545;
  color: #721c24;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn-danger:hover {
  background: linear-gradient(135deg, #f5c6cb 0%, #f1aeb5 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.documents-container {
  flex: 1;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  border: 1px solid rgba(25, 118, 210, 0.2);
  position: relative;
}

.documents-list {
  height: 100%;
  overflow-y: auto;
  padding: 15px;
}

/* 文档项样式 */
.document-item {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid rgba(25, 118, 210, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.document-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.15);
  border-color: #42a5f5;
}

.document-item:last-child {
  margin-bottom: 0;
}

.document-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
}

.document-checkbox {
  display: flex;
  align-items: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.document-checkbox-input {
  display: none;
}

.document-checkbox-label {
  width: 18px;
  height: 18px;
  border: 2px solid #42a5f5;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  background: white;
}

.document-checkbox-label:hover {
  border-color: #1976d2;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

.document-checkbox-input:checked + .document-checkbox-label {
  background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
  border-color: #1976d2;
}

.document-checkbox-input:checked + .document-checkbox-label::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.document-details {
  flex: 1;
}

.document-name {
  font-size: 16px;
  font-weight: 600;
  color: #1976d2;
  margin-bottom: 6px;
  word-break: break-word;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 13px;
  color: #666;
}

.document-size,
.document-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.document-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.vector-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  min-width: 60px;
}

.vector-status.pending {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.vector-status.processing {
  background: #cce5ff;
  color: #0066cc;
  border: 1px solid #66b3ff;
}

.vector-status.completed {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.vector-status.failed {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 新的向量状态样式 */
.vector-status.Initial {
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

.vector-status.Successful {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.vector-status.Failed {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.document-action-btn {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 1px solid #42a5f5;
  color: #1976d2;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.document-action-btn:hover {
  background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(25, 118, 210, 0.2);
}

.document-action-btn.delete {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  border-color: #f44336;
  color: #c62828;
}

.document-action-btn.delete:hover {
  background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 100%);
  box-shadow: 0 3px 10px rgba(244, 67, 54, 0.2);
}

/* 为向量化按钮添加样式 */
.document-action-btn.vector {
  background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
  border-color: #28a745;
  color: #155724;
}

.document-action-btn.vector:hover {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  box-shadow: 0 3px 10px rgba(40, 167, 69, 0.2);
}

.document-action-btn.vector:disabled {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-color: #6c757d;
  color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.document-action-btn.vector:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* 深色主题向量化按钮样式 */
body[data-theme="dark"] .document-action-btn.vector {
  background: linear-gradient(135deg, #2a4a2a 0%, #3a5a3a 100%);
  border-color: #66bb6a;
  color: #c8e6c9;
}

body[data-theme="dark"] .document-action-btn.vector:hover {
  background: linear-gradient(135deg, #3a5a3a 0%, #4a6a4a 100%);
  box-shadow: 0 3px 10px rgba(102, 187, 106, 0.3);
}

body[data-theme="dark"] .document-action-btn.vector:disabled {
  background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
  border-color: #5a5a5a;
  color: #888;
}

/* 空状态 */
.empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #666;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: #888;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  color: #aaa;
}

/* 主题适配 */

/* 默认（蓝色）主题向量状态 */
body .vector-status.pending,
body[data-theme="blue"] .vector-status.pending {
  background: #cce5ff;
  color: #0066cc;
  border: 1px solid #66b3ff;
}

body .vector-status.processing,
body[data-theme="blue"] .vector-status.processing {
  background: #cce5ff;
  color: #0066cc;
  border: 1px solid #66b3ff;
}

body .vector-status.completed,
body[data-theme="blue"] .vector-status.completed {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

body .vector-status.failed,
body[data-theme="blue"] .vector-status.failed {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

body .vector-status.Initial,
body[data-theme="blue"] .vector-status.Initial {
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

body .vector-status.Successful,
body[data-theme="blue"] .vector-status.Successful {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

body .vector-status.Failed,
body[data-theme="blue"] .vector-status.Failed {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 黑色主题 */
body[data-theme="dark"] .document-layout {
  color: #ffffff;
}

body[data-theme="dark"] .document-header h2 {
  color: #90caf9;
}

body[data-theme="dark"] .document-header p {
  color: #bbb;
}

body[data-theme="dark"] .upload-container {
  background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
  border-color: #42a5f5;
}

body[data-theme="dark"] .upload-container:hover {
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
}

body[data-theme="dark"] .upload-info {
  color: #bbb;
}

body[data-theme="dark"] .documents-header h3 {
  color: #90caf9;
}

body[data-theme="dark"] .documents-count {
  color: #bbb;
  background: rgba(144, 202, 249, 0.1);
  border-color: rgba(144, 202, 249, 0.3);
}

body[data-theme="dark"] .documents-actions {
  background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
  border-color: rgba(144, 202, 249, 0.2);
}

body[data-theme="dark"] .action-btn-secondary {
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
  border-color: #6c757d;
  color: #adb5bd;
}

body[data-theme="dark"] .action-btn-secondary:hover {
  background: linear-gradient(135deg, #4a4a4a 0%, #5a5a5a 100%);
}

body[data-theme="dark"] .action-btn-danger {
  background: linear-gradient(135deg, #4a2a2a 0%, #5a3a3a 100%);
  border-color: #dc3545;
  color: #f5c6cb;
}

body[data-theme="dark"] .action-btn-danger:hover {
  background: linear-gradient(135deg, #5a3a3a 0%, #6a4a4a 100%);
}

body[data-theme="dark"] .document-action-btn {
  background: linear-gradient(135deg, #2a3a4a 0%, #3a4a5a 100%);
  border-color: #90caf9;
  color: #90caf9;
}

body[data-theme="dark"] .document-action-btn:hover {
  background: linear-gradient(135deg, #3a4a5a 0%, #4a5a6a 100%);
  box-shadow: 0 3px 10px rgba(144, 202, 249, 0.3);
}

body[data-theme="dark"] .document-action-btn.delete {
  background: linear-gradient(135deg, #4a2a2a 0%, #5a3a3a 100%);
  border-color: #f5c6cb;
  color: #f5c6cb;
}

body[data-theme="dark"] .document-action-btn.delete:hover {
  background: linear-gradient(135deg, #5a3a3a 0%, #6a4a4a 100%);
  box-shadow: 0 3px 10px rgba(245, 198, 203, 0.3);
}

body[data-theme="dark"] .documents-container {
  background: rgba(30, 30, 30, 0.9);
  border-color: rgba(144, 202, 249, 0.3);
}

body[data-theme="dark"] .document-item {
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
  border-color: rgba(144, 202, 249, 0.2);
  color: #ffffff;
}

body[data-theme="dark"] .document-item:hover {
  border-color: #90caf9;
  box-shadow: 0 6px 20px rgba(144, 202, 249, 0.2);
}

body[data-theme="dark"] .document-name {
  color: #90caf9;
}

body[data-theme="dark"] .document-meta {
  color: #bbb;
}

body[data-theme="dark"] .document-checkbox-label {
  border-color: #90caf9;
  background: #3a3a3a;
}

body[data-theme="dark"] .document-checkbox-label:hover {
  border-color: #90caf9;
  box-shadow: 0 2px 8px rgba(144, 202, 249, 0.2);
}

body[data-theme="dark"] .document-checkbox-input:checked + .document-checkbox-label {
  background: linear-gradient(135deg, #90caf9 0%, #42a5f5 100%);
  border-color: #90caf9;
}

body[data-theme="dark"] .empty-state {
  color: #bbb;
}

body[data-theme="dark"] .empty-state h4 {
  color: #999;
}

body[data-theme="dark"] .empty-state p {
  color: #777;
}

/* 暗色主题向量状态 */
body[data-theme="dark"] .vector-status.pending {
  background: rgba(144, 202, 249, 0.2);
  color: #90caf9;
  border: 1px solid rgba(144, 202, 249, 0.3);
}

body[data-theme="dark"] .vector-status.processing {
  background: rgba(144, 202, 249, 0.2);
  color: #90caf9;
  border: 1px solid rgba(144, 202, 249, 0.3);
}

body[data-theme="dark"] .vector-status.completed {
  background: rgba(102, 187, 106, 0.2);
  color: #a5d6a7;
  border: 1px solid rgba(102, 187, 106, 0.3);
}

body[data-theme="dark"] .vector-status.failed {
  background: rgba(239, 154, 154, 0.2);
  color: #ef9a9a;
  border: 1px solid rgba(239, 154, 154, 0.3);
}

body[data-theme="dark"] .vector-status.Initial {
  background: rgba(97, 97, 97, 0.2);
  color: #bbb;
  border: 1px solid rgba(97, 97, 97, 0.3);
}

body[data-theme="dark"] .vector-status.Successful {
  background: rgba(102, 187, 106, 0.2);
  color: #a5d6a7;
  border: 1px solid rgba(102, 187, 106, 0.3);
}

body[data-theme="dark"] .vector-status.Failed {
  background: rgba(239, 154, 154, 0.2);
  color: #ef9a9a;
  border: 1px solid rgba(239, 154, 154, 0.3);
}

/* 白色主题 */
body[data-theme="light"] .document-layout {
  color: #333;
}

body[data-theme="light"] .document-header h2 {
  color: #1976d2;
}

body[data-theme="light"] .document-header p {
  color: #666;
}

body[data-theme="light"] .upload-container {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-color: #1976d2;
}

body[data-theme="light"] .upload-container:hover {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

body[data-theme="light"] .upload-info {
  color: #666;
}

body[data-theme="light"] .documents-header h3 {
  color: #1976d2;
}

body[data-theme="light"] .documents-count {
  color: #666;
  background: rgba(25, 118, 210, 0.1);
  border-color: rgba(25, 118, 210, 0.2);
}

body[data-theme="light"] .documents-actions {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-color: rgba(25, 118, 210, 0.1);
}

body[data-theme="light"] .action-btn-secondary {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-color: #6c757d;
  color: #495057;
}

body[data-theme="light"] .action-btn-secondary:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

body[data-theme="light"] .action-btn-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-color: #dc3545;
  color: #721c24;
}

body[data-theme="light"] .action-btn-danger:hover {
  background: linear-gradient(135deg, #f5c6cb 0%, #f1aeb5 100%);
}

body[data-theme="light"] .document-action-btn {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #42a5f5;
  color: #1976d2;
}

body[data-theme="light"] .document-action-btn:hover {
  background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
  box-shadow: 0 3px 10px rgba(25, 118, 210, 0.2);
}

body[data-theme="light"] .document-action-btn.delete {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  border-color: #f44336;
  color: #c62828;
}

body[data-theme="light"] .document-action-btn.delete:hover {
  background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 100%);
  box-shadow: 0 3px 10px rgba(244, 67, 54, 0.2);
}

body[data-theme="light"] .documents-container {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(25, 118, 210, 0.2);
}

body[data-theme="light"] .document-item {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-color: rgba(25, 118, 210, 0.15);
  color: #333;
}

body[data-theme="light"] .document-item:hover {
  border-color: #42a5f5;
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.15);
}

body[data-theme="light"] .document-name {
  color: #1976d2;
}

body[data-theme="light"] .document-meta {
  color: #666;
}

body[data-theme="light"] .document-checkbox-label {
  border-color: #42a5f5;
  background: white;
}

body[data-theme="light"] .document-checkbox-label:hover {
  border-color: #1976d2;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

body[data-theme="light"] .document-checkbox-input:checked + .document-checkbox-label {
  background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
  border-color: #1976d2;
}

body[data-theme="light"] .empty-state {
  color: #666;
}

body[data-theme="light"] .empty-state h4 {
  color: #888;
}

body[data-theme="light"] .empty-state p {
  color: #aaa;
}

/* 浅色主题向量状态 */
body[data-theme="light"] .vector-status.pending {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

body[data-theme="light"] .vector-status.processing {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

body[data-theme="light"] .vector-status.completed {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

body[data-theme="light"] .vector-status.failed {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

body[data-theme="light"] .vector-status.Initial {
  background: #f5f5f5;
  color: #757575;
  border: 1px solid #e0e0e0;
}

body[data-theme="light"] .vector-status.Successful {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

body[data-theme="light"] .vector-status.Failed {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

/* 动画定义 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .document-layout {
    padding: 15px;
    gap: 20px;
  }
  
  .upload-container {
    padding: 20px;
  }
  
  .document-info {
    flex-direction: column;
    gap: 10px;
  }
  
  .document-actions {
    flex-direction: row;
    align-self: flex-start;
  }
    .documents-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .header-right {
    justify-content: flex-start;
  }
  
  .documents-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .refresh-btn,
  .action-btn-secondary,
  .action-btn-danger {
    font-size: 12px;
    padding: 6px 12px;
  }
}
